fix(rule): add @JsonIgnoreProperties(ignoreUnknown=true) for Change Feed + harness improvements#36
Conversation
- Change hardcoded default database name in cosmos_database fixture from 'gaming-leaderboard-db' to 'test-db'. The previous default was specific to the gaming-leaderboard scenario and would silently use the wrong database for other scenarios when iteration-config.yaml omits the 'database' field. - Add .gitignore to each scenario's iterations/ directory to prevent accidentally committing language-specific build artifacts (node_modules, __pycache__, bin/obj, target, etc.) and CI temp files.
|
/aggregate 1,2,3 |
Addresses AzureCosmosDB#28 — Cosmos DB entity classes without this annotation fail with UnrecognizedPropertyException on system metadata fields (_lsn, _rid, _ts, _etag, _self) during Change Feed deserialization. This was the most prevalent defect in SCOPE evaluation (94% hit rate across all profiles). Added as Rule 5 in model-json-serialization.
|
Thanks for this! A few things need to be adjusted before merge:
I'll fix the CI trigger issue separately by narrowing the path filter in auto-trigger-tests.yaml from testing-v2/scenarios//iterations/** to testing-v2/scenarios//iterations/iteration-*/** so that only actual iteration subdirectories trigger the test pipeline. Please scope this PR to just the rule change (with the AGENTS.md rebuild). |
|
Closed as fixed by PR: #45 |
Summary
Fixes #28 — Adds
@JsonIgnoreProperties(ignoreUnknown = true)requirement tomodel-json-serializationrule. This was the most prevalent defect in the SCOPE evaluation (94% hit rate across all profiles), causingUnrecognizedPropertyExceptionon Cosmos DB system metadata fields (_lsn,_rid,_ts,_etag,_self) during Change Feed deserialization.Also includes two small harness improvements:
conftest_base.py(gaming-leaderboard-db→test-db).gitignoreto iterations directories to prevent accidental commits of build artifactsChanges
skills/cosmosdb-best-practices/rules/model-json-serialization.md— add Rule 5 for@JsonIgnorePropertiestesting-v2/harness/conftest_base.py— use generic default database nametesting-v2/scenarios/*/iterations/.gitignore— new file (all 5 scenarios)Testing
Rule changes are additive (new Rule 5 added, existing rules unchanged). The harness default database change only affects edge cases where
iteration-config.yamlomits thedatabasefield.